// $Id: ScreenTemplate.java 9 2008-08-30 17:34:11Z moyekj@yahoo.com $

package com.hme.tivo.videostream;

import com.tivo.hme.bananas.BApplication;
import com.tivo.hme.bananas.BScreen;

public class ScreenTemplate extends BScreen {

   public ScreenTemplate(BApplication app) {
      super(app);
      if (this.toString() != null) {
         // Set background and title
         getBelow().setResource(GLOBAL.BACKGROUND_PICTURE); 
         setTitle(this.toString());
      }
   }
    
   // Set the title of the window in a safe area of the screen.
   private void setTitle(String t) {
      debug.print("t=" + t);
      VText title = new VText(
         getNormal(), SAFE_TITLE_H, SAFE_TITLE_V-20, 1, "title"
      );
      title.setValue(t);
      title.setColor(GLOBAL.title_COLOR);
      title.setFlags(RSRC_VALIGN_TOP | RSRC_HALIGN_CENTER);
   }
  
   // Pass key events up to parent class
   public boolean handleKeyPress(int code, long rawcode) {  
      return super.handleKeyPress(code, rawcode);
   }      
}
